#ifndef LIBRARY_H
#define LIBRARY_H

#ifdef __APPLE__
#include <GL/glew.h>
#include <GLUT/glut.h>
#include <OpenGl/Gl.h>
#else
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/freeglut.h>
#endif

#include <iostream>
#include <png.h>
#include <math.h>
#include <time.h>

#define PI 3.141592
#define HALFPI PI / 2
#define PIOVER180 PI / 180
#define PNG_HEADER_SIZE 8

typedef GLfloat* Vector;
/**
* textureInfo
*
* Information about a texture
* uiWidth	Width of the texture
* uiHeight	Height of the texture
* ucFilter	1-bit value of the chosen filtering 
*				0(MipMapped NN), 1(MipMapped Linear)
* GLuint		Pointer to an OpenGL-texture
*
*/
typedef struct Texture {
	unsigned int	uiWidth;
	unsigned int	uiHeight;
	unsigned char	ucFilter : 1;
	GLuint			gluiTexture;
} textureInfo;
/**
* Image
*
* Information about a raw image
* uiWidth	Width of the texture
* uiHeight	Height of the texture
* pucData	Pointer to the raw data
*
*/
typedef struct _Image {
    unsigned int	uiWidth;
    unsigned int	uiHeight;
    unsigned char	*pucData;
} Image;

int GetMilliseconds();
GLfloat GetDistance(Vector vector);
Image LoadPNGImage(const char *pucFileName, unsigned char ucKeepAlpha, unsigned char ucPixelSize);
Texture LoadPNGTexture(const char *pucFilename, unsigned int uiDepth, unsigned char ucFilter);

#endif
